<?php 
  //$products = get_products_by_category_id($category_id);
  if ($products) {
?>

<h2 class="porduct_img"><?php echo $title;?></h2>
<div class="content">
  <?php foreach ($products as $product) {?>
  <div class="porduct_main">
    <?php if ($product['image'] && file_exists(ROOT . '/content/upload/product/' . $product['image'])) {?>
      <img src="content/upload/product/<?php echo $product['image'];?>" alt="<?php echo $product['name'];?>" />
    <?php } else {?>
      <img src="content/theme/<?php echo THEME;?>/images/product_no_image.gif" alt="暂时没有图片" />
    <?php }?>
    <table class="porduct_description" border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <th>名称：</th>
        <td><a href="<?php echo url('?module=product&product_id=' . $product['id']);?>"><?php echo $product['name'];?></a></td>
      </tr>
      <tr>
        <th>描述：</th>
        <td><?php echo mb_strimwidth($product['description'], 0, 20, "...");?></td>
      </tr>
    </table>
  </div>
  <?php }?>
  <table class="page" border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
      <td class="td01"><?php echo $listing_split->display_count('显示 <b>%d</b> 到 <b>%d</b> (共 <b>%d</b> 个商品)'); ?></td>
      <td class="td02" align="right"><?php echo '页数：' . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, 'module=category&category_id=1'); ?></td>
    </tr>
  </table>
  <?php
  }
?>
</div>
